.class public Les/x00;
.super Ljava/lang/Object;
.source "WifiApSettings.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/x00$b;
    }
.end annotation


# instance fields
.field private final a:Landroid/content/Context;

.field private b:Landroid/net/wifi/WifiManager;

.field private c:Landroid/content/IntentFilter;

.field private d:Landroid/content/SharedPreferences;

.field private e:Les/x00$b;

.field private final f:Landroid/content/BroadcastReceiver;


# direct methods
.method public constructor <init>(Landroid/content/Context;Les/x00$b;)V
    .locals 1

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Les/x00$a;

    invoke-direct {v0, p0}, Les/x00$a;-><init>(Les/x00;)V

    iput-object v0, p0, Les/x00;->f:Landroid/content/BroadcastReceiver;

    .line 3
    iput-object p1, p0, Les/x00;->a:Landroid/content/Context;

    .line 4
    iput-object p2, p0, Les/x00;->e:Les/x00$b;

    .line 5
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object p2

    const-string v0, "wifi"

    invoke-virtual {p2, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Landroid/net/wifi/WifiManager;

    iput-object p2, p0, Les/x00;->b:Landroid/net/wifi/WifiManager;

    const-string p2, "wifi_setting"

    const/4 v0, 0x0

    .line 6
    invoke-virtual {p1, p2, v0}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object p1

    iput-object p1, p0, Les/x00;->d:Landroid/content/SharedPreferences;

    .line 7
    new-instance p1, Landroid/content/IntentFilter;

    const-string p2, "android.net.wifi.WIFI_AP_STATE_CHANGED"

    invoke-direct {p1, p2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    iput-object p1, p0, Les/x00;->c:Landroid/content/IntentFilter;

    return-void
.end method

.method static synthetic a(Les/x00;)Les/x00$b;
    .locals 0

    .line 1
    iget-object p0, p0, Les/x00;->e:Les/x00$b;

    return-object p0
.end method


# virtual methods
.method public a()V
    .locals 3

    .line 9
    invoke-static {}, Lcom/estrongs/android/util/q;->a()V

    .line 10
    iget-object v0, p0, Les/x00;->d:Landroid/content/SharedPreferences;

    const-string v1, "wifi_saved_state"

    const/4 v2, -0x1

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    const/4 v2, 0x1

    if-ne v0, v2, :cond_0

    .line 11
    iget-object v0, p0, Les/x00;->b:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0, v2}, Landroid/net/wifi/WifiManager;->setWifiEnabled(Z)Z

    .line 12
    iget-object v0, p0, Les/x00;->d:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const/4 v2, 0x0

    .line 13
    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 14
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V

    :cond_0
    return-void
.end method

.method public a(Landroid/net/wifi/WifiConfiguration;)Z
    .locals 4

    .line 2
    iget-object v0, p0, Les/x00;->b:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->getWifiState()I

    move-result v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    const/4 v3, 0x2

    if-eq v0, v3, :cond_0

    const/4 v3, 0x3

    if-ne v0, v3, :cond_1

    .line 3
    :cond_0
    iget-object v0, p0, Les/x00;->b:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0, v2}, Landroid/net/wifi/WifiManager;->setWifiEnabled(Z)Z

    .line 4
    iget-object v0, p0, Les/x00;->d:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v3, "wifi_saved_state"

    .line 5
    invoke-interface {v0, v3, v1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    .line 6
    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V

    .line 7
    :cond_1
    invoke-static {p1, v1}, Lcom/estrongs/android/util/q;->a(Landroid/net/wifi/WifiConfiguration;Z)Z

    move-result p1

    if-eqz p1, :cond_2

    .line 8
    iget-object p1, p0, Les/x00;->e:Les/x00$b;

    const/16 v0, 0xc

    invoke-interface {p1, v0}, Les/x00$b;->e(I)V

    :cond_2
    return v2
.end method

.method public b()Landroid/net/wifi/WifiConfiguration;
    .locals 1

    .line 1
    invoke-static {}, Lcom/estrongs/android/util/q;->d()Landroid/net/wifi/WifiConfiguration;

    move-result-object v0

    return-object v0
.end method

.method public c()V
    .locals 2

    .line 1
    iget-object v0, p0, Les/x00;->a:Landroid/content/Context;

    iget-object v1, p0, Les/x00;->f:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v1}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    return-void
.end method

.method public d()V
    .locals 3

    .line 1
    iget-object v0, p0, Les/x00;->a:Landroid/content/Context;

    iget-object v1, p0, Les/x00;->f:Landroid/content/BroadcastReceiver;

    iget-object v2, p0, Les/x00;->c:Landroid/content/IntentFilter;

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    return-void
.end method
